<?php

namespace app\api\controller;
use think\Controller;
use think\Db;
use think\Request;

class ImgCode extends Controller
{
    //获取验证码
    public function imgCode()
    {
        $config = [
            'useCurve'=>false,
            'length'      =>    4, // 验证码位数
        ];
        $captcha = new \think\captcha\Captcha($config);
        return $captcha->entry();
    }
}